package com.kifas.entity;

import java.io.Serializable;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "tb_jenis_barang")
public class JenisBarangEntity implements Serializable {

	private static final long serialVersionUID = -4207282081859767162L;

	@Id
	@GeneratedValue
	@Column(name = "id_jenis_barang")
	private Long idJenisBarang;

	private String jenis;

	@OneToMany(mappedBy = "jenisBarang", targetEntity = BarangEntity.class, fetch = FetchType.LAZY)
	private Set<BarangEntity> barangs;
	
	@Column(name= "created_by")
	private String createdBy;

	public JenisBarangEntity() {
	}

	public JenisBarangEntity(Long idJenisBarang, String jenis) {
		this.idJenisBarang = idJenisBarang;
		this.jenis = jenis;
	}
	
	public JenisBarangEntity(Long idJenisBarang, String jenis, String createdBy) {
		this.idJenisBarang = idJenisBarang;
		this.jenis = jenis;
		this.createdBy = createdBy;
	}

	public Long getIdJenisBarang() {
		return idJenisBarang;
	}

	public void setIdJenisBarang(Long idJenisBarang) {
		this.idJenisBarang = idJenisBarang;
	}

	public String getJenis() {
		return jenis;
	}

	public void setJenis(String jenis) {
		this.jenis = jenis;
	}

	public Set<BarangEntity> getBarangs() {
		return barangs;
	}

	public void setBarangs(Set<BarangEntity> barangs) {
		this.barangs = barangs;
	}

	public void setCreatedBy(String createdBy) {
		this.createdBy = createdBy;
	}

	public String getCreatedBy() {
		return createdBy;
	}

}
